import {request} from "../request";

//1、新建一个请假流程
export function createLeaveProcess({startUser, startUserName, holidayType, holidayTypeName, endTime, beginTime, days, cause, leaderAssignee, perAssignee,}){
	return request({
		url: '/process/leave/create',
		method: 'post',
		data: {startUser, startUserName, holidayType, holidayTypeName, endTime, beginTime, days, cause, leaderAssignee, perAssignee,}
	})
}

//2、获取请假的审批人员
export function queryLeaveAssessingOfficer(userId){
	return request({
		url: '/process/leave/assessing-officer',
		method: 'get',
		params: {
			userId
		}
	})
}

//3、获取我要审批的请假任务
export function queryMyAuditLeaveTask(userId){
	return request({
		url: '/process/leave/audit-task',
		method: 'get',
		params:{
			userId
		}
	})
}

//4、查看我的请假申请
export function queryPersonalLeaveProcess(userId){
	return request({
		url: '/process/leave/personal-start',
		method: 'get',
		params:{
			userId
		}
	})
}

//5、完成审批任务
export function completeLeaveAuditTask({taskId,approved,reply}){
	return request({
		url: '/process/leave/examine-approved',
		method: 'put',
		params: {taskId,approved,reply}
	})
}

//6、查看我的出差申请详情
export function getLeaveApplyDetail(processInstanceId){
	return request({
		url: '/process/leave/leave-apply-detail',
		method: 'get',
		params: {
			processInstanceId
		}
	})
}

//7、查看出差审批任务详情
export function queryLeaveAccreditationDetail(taskId){
	return request({
		url: '/process/leave/accreditation-detail',
		method: 'get',
		params:{
			taskId
		}
	})
}